package com.yc.bigdata.flink.demo.util;

/**
 * <p></p>
 *
 * @author: YuanChilde
 * @date: 2020-02-14 15:28
 * @version: 1.0
 * Modification History:
 * Date    Author      Version     Description
 * -----------------------------------------------------------------
 * 2020-02-14 15:28    YuanChilde     1.0        新增
 */
public class KafkaSendDataCassandra {
    public static void main(String[] args) {
        for (int i = 0; i < 100000; i++) {
/*            POJO pojo = new POJO();
            int j = random.nextInt(5);
            pojo.setAid("ID000-" + i);
            pojo.setAname("NAME-" + i);
            pojo.setAstyle("STYLE000-" + j);
            pojo.setEnergy(new BigDecimal(random.nextInt(1000)).setScale(2, RoundingMode.HALF_UP));
            pojo.setAge((j == 0 ? 1 : j) * 13);
            long time = System.currentTimeMillis();
            pojo.setTt(new Date(time));
            pojo.setLogTime(time);

            ZoneId shanghaiZoneId = ZoneId.of("Asia/Shanghai");
            ZonedDateTime shanghaiZonedDateTime = ZonedDateTime.now(shanghaiZoneId);

            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");

            pojo.setCreateTime(shanghaiZonedDateTime.format(formatter));
            pojo.setUpdateTime(shanghaiZonedDateTime.format(formatter));

            pojo.setAstatus("0" + j);

            String value = gson.toJson(pojo);

            producer.send(new ProducerRecord<String, String>(AsyncCassandraJob.class.getSimpleName(), Integer.toString(i), value));

            System.out.println(value);*/
        }
    }
}
